home *** CD-ROM | disk | FTP | other *** search
-
-
- go:
- if visible "help window" == TRUE
- undisplay element "help window"
- if visible "status" == TRUE
- textbox "status" = " "
- undisplay element "status"
- if visible "scoreback" == TRUE
- undisplay element "scoreback"
- if visible "scorebox" == TRUE
- undisplay element "scorebox"
- if visible "rating" == TRUE
- undisplay element "rating"
- if visible "landing" == TRUE
- undisplay element "landing"
- if visible "fuelbonus" == TRUE
- undisplay element "fuelbonus"
- if visible "subtotal" == TRUE
- undisplay element "subtotal"
- if visible "landingsite" == TRUE
- undisplay element "landingsite"
- if visible "totalscore" == TRUE
- undisplay element "totalscore"
- ships_ = ships_ - 1
- if ships_ < 0
- display element "moonscap"
- call new_game
- ships_ = ships_ - 1
- editbox "score" = score_
- break mode 0
- mouse position 320,240
- mouse mode OFF
- editbox "ships" = ships_
- editbox "fuel" = "100"
- editbox "fps" = "0"
- landing_site = 0
- fuel_bonus = 0
- fuel_percent = 100
- crash = FALSE
- landing = FALSE
- stat_switch = 0
- play_problem = 0
- flame = 0
- yaw = 1
- gravity = 2
- thrust = 1
- left = 1
- right = 2
- fuel = 225
- fps_time = TIMER
- fps_switch = 0
- gg = 2
- en = 0
- yy = 40
- yyy = 40
- xx = 1
- loop_= 1
- while loop_ == 1
- update_sprite_time = TIMER
- gravity = gravity * 1.013 - thrust + 1
- if fuel_percent < 20
- if fuel > 1
- if visible "status" == FALSE
- display element "status"
- textbox "status" = "WARNING: LOW FUEL"
- if playing "moonmus.wav" == TRUE
- stop element "moonmus.wav"
- if flame == 0
- if playing "alarm.wav" == FALSE
- if playing "problem.wav" == FALSE
- display element "alarm.wav"
- if fuel < 1
- flame = 0
- if stat_switch == 0
- if visible "status" == FALSE
- display element "status"
- textbox "status" = "YOU ARE OUT OF FUEL."
- stat_switch = 1
- if play_problem == 0
- if fps_ > 1.5
- if playing "thrust.wav" == TRUE
- stop element "thrust.wav"
- if playing "moonmus.wav" == TRUE
- stop element "moonmus.wav"
- if playing "alarm.wav" == TRUE
- stop element "alarm.wav"
- display element "problem.wav"
- play_problem = 1
- if flame == 1
- thrust = thrust * 1.014
- fuel = fuel - 1
- fuel_percent = fuel / 2.25
- editbox "fuel" = fuel_percent
- if flame == 0
- if en == 1
- thrust = thrust / 1.014
- if flame == 1
- if yaw == 0
- left = left*1.01
- right = right/1.01
- gg = 1
- if yaw == 2
- left = left/1.01
- right = right*1.01
- gg = 2
- if left < 1
- left = 1
- if right < 1
- right = 1
- if gg == 1
- go_ = (left-right)* -1
- if gg == 2
- go_ = right-left
- if abs go_ <= 0.3
- go_ = 0
- xx = xx + go_
- if xx > 603
- xx = 1
- if xx < 1
- xx = 603
- if gravity + yyy < yy
- en = 1
- if gravity + yyy > yy
- if en == 1
- thrust = 1
- gravity = 2
- en = 0
- yyy = yy - 2
- yy = gravity + yyy
- if fps_switch == 0
- yyyy = yy
- fps_switch = 1
- if TIMER-fps_time > 10
- fps_time = TIMER
- fps_ = floor((yy - yyyy)*10)
- fps_ = fps_ + gravity - floor gravity
- editbox "fps"= fps_
- fps_switch = 0
- if yy < 36
- call reset_sprites
- update sprites
- if playing "alarm.wav" == TRUE
- stop element "alarm.wav"
- if playing "thrust.wav" == TRUE
- stop element "thrust.wav"
- if playing "moonmus.wav" == FALSE
- if music_ == TRUE
- display element "moonmus.wav"
- ships_ = ships_ + 1
- display element "status"
- textbox "status" = "You have left the moon!"
- mouse position 320,240
- mouse mode ON
- return
- peek message mes,a,b,c
- if mes == WM_RBUTTONDOWN
- mes = 0
- stop sound
- stat_switch = 0
- if visible "status" == TRUE
- textbox "status" = "PAUSED"
- while mes != WM_RBUTTONDOWN
- peek message mes,a,b,c
- if visible "status" == FALSE
- display element "status"
- textbox "status" = "PAUSED"
- textbox "status" = " "
- undisplay element "status"
- flame = 0
- if WM_LBUTTONDOWN == mes
- if fuel > 0
- flame = 1
- if WM_LBUTTONUP == mes
- flame = 0
- if LAST_MOUSE_XPOS <= 213
- yaw = 0
- if LAST_MOUSE_XPOS >= 427
- yaw = 2
- if LAST_MOUSE_XPOS < 427
- if LAST_MOUSE_XPOS > 213
- yaw = 1
- if LAST_MOUSE_YPOS > 400
- mouse position LAST_MOUSE_XPOS,400
- if yaw == 0
- if flame == 1
- call reset_sprites
- sprite lemlfs bitmap lemlf at xx,yy
- if flame == 0
- call reset_sprites
- sprite lemls bitmap leml at xx,yy
- if yaw == 1
- if flame == 1
- call reset_sprites
- sprite lemfs bitmap lemf at xx,yy
- if flame == 0
- call reset_sprites
- sprite lems bitmap lem at xx,yy
- if yaw == 2
- if flame == 1
- call reset_sprites
- sprite lemrfs bitmap lemrf at xx-1,yy+1
- if flame == 0
- call reset_sprites
- sprite lemrs bitmap lemr at xx,yy
- if flame == 0
- if playing "thrust.wav" == TRUE
- stop element "thrust.wav"
- if playing "moonmus.wav" == FALSE
- if play_problem == 0
- if music_ == TRUE
- if fuel_percent >= 20
- display element "moonmus.wav"
- if flame == 1
- if playing "alarm.wav" == TRUE
- stop element "alarm.wav"
- if playing "thrust.wav" == FALSE
- display element "thrust.wav"
- while update_sprite_time > TIMER-3
- update sprites
- if yaw == 1
- call landing_test
- if landing == TRUE
- if ships_ == 0
- call high_score
- if visible "status" == FALSE
- display element "status"
- textbox "status" = "GAME OVER"
- mouse position 320,240
- mouse mode ON
- return
- call crash_test
- if crash == TRUE
- if ships_ == 0
- if score_ <= high.score
- if music_ == TRUE
- display element "moonmus.wav"
- call high_score
- if visible "status" == FALSE
- display element "status"
- textbox "status" = "GAME OVER"
- if ships_ > 0
- if music_ == TRUE
- display element "moonmus.wav"
- mouse position 320,240
- mouse mode ON
- return
- //----------------------------------
- preload_:
- if file_exist "hiscore.dat" == TRUE
- load "hiscore.dat" structure high
- if file_exist "hiscore.dat" == FALSE
- high = new structure
- high.score = 0
- save "hiscore.dat" object high
- highscore_ = high.score
- music_ = TRUE
- load "moonscap.gif" bitmap moon
- load "lem.gif" bitmap lem
- remap bitmap lem
- load "lemf.gif" bitmap lemf
- remap bitmap lemf
- load "leml.gif" bitmap leml
- remap bitmap leml
- load "lemlf.gif" bitmap lemlf
- remap bitmap lemlf
- load "lemr.gif" bitmap lemr
- remap bitmap lemr
- load "lemrf.gif" bitmap lemrf
- remap bitmap lemrf
- load "lemflag.gif" bitmap flag
- remap bitmap flag
- load "exp1.gif" bitmap exp1
- remap bitmap exp1
- load "exp2.gif" bitmap exp2
- remap bitmap exp2
- load "exp3.gif" bitmap exp3
- remap bitmap exp3
- load "exp4.gif" bitmap exp4
- remap bitmap exp4
- load "exp5.gif" bitmap exp5
- remap bitmap exp5
- load "exp6.gif" bitmap exp6
- remap bitmap exp6
- load "exp7.gif" bitmap exp7
- remap bitmap exp7
- load "exp8.gif" bitmap exp8
- remap bitmap exp8
- load "exp9.gif" bitmap exp9
- remap bitmap exp9
- //-----------------------------------
- //if SOUND_DEVICE == TRUE
- load "explode.wav" sound exp_sound
- load "weredead.wav" sound were_dead
- load "thatis.wav" sound thatis
- load "neil.wav" sound neil
- load "flag.wav" sound drums
- load "fanfare.wav" sound fanfare
- load "photon.wav" sound photon
- load "cool.wav" sound cool
- //-----------------------------------
- lems = new sprite
- lemfs = new sprite
- lemls = new sprite
- lemlfs = new sprite
- lemrs = new sprite
- lemrfs = new sprite
- exp1s = new sprite
- exp2s = new sprite
- exp3s = new sprite
- exp4s = new sprite
- exp5s = new sprite
- exp6s = new sprite
- exp7s = new sprite
- exp8s = new sprite
- exp9s = new sprite
- return
- //-----------------------------------
- explode:
- if visible "status" == TRUE
- textbox "status" = " "
- undisplay element "status"
- if yaw == 0
- call reset_sprites
- sprite lemls bitmap leml at xx,yy
- if yaw == 1
- call reset_sprites
- sprite lems bitmap lem at xx,yy
- if yaw == 2
- call reset_sprites
- sprite lemrs bitmap lemr at xx,yy
- update sprites
- play sound were_dead
- wait sound
- sprite exp1s bitmap exp1 at xx-17,yy-11
- update sprites
- play sound exp_sound
- sprite exp1s bitmap exp1 at xx+640,yy
- sprite exp2s bitmap exp2 at xx-30,yy-20
- delay 12
- update sprites
- sprite exp2s bitmap exp2 at xx+640,yy
- sprite exp1s bitmap exp1 at xx-17,yy-11
- delay 12
- update sprites
- sprite exp1s bitmap exp1 at xx+640,yy
- sprite exp3s bitmap exp3 at xx-12,yy-9
- delay 24
- update sprites
- sprite exp3s bitmap exp3 at xx+640,yy
- sprite exp4s bitmap exp4 at xx-12,yy-9
- delay 24
- update sprites
- sprite exp4s bitmap exp4 at xx+640,yy
- sprite exp5s bitmap exp5 at xx-12,yy-9
- delay 26
- update sprites
- sprite exp5s bitmap exp5 at xx+640,yy
- sprite exp6s bitmap exp6 at xx-12,yy-9
- delay 26
- update sprites
- sprite exp6s bitmap exp6 at xx+640,yy
- sprite exp7s bitmap exp7 at xx-12,yy-9
- delay 26
- update sprites
- sprite exp7s bitmap exp7 at xx+640,yy
- sprite exp8s bitmap exp8 at xx-12,yy-9
- delay 26
- update sprites
- sprite exp8s bitmap exp8 at xx+640,yy
- sprite exp9s bitmap exp9 at xx-12,yy-9
- delay 26
- update sprites
- call reset_sprites
- update sprites
- sprite exp9s bitmap exp9 at xx+640,yy
- delay 26
- update sprites
- wait sound
- crash = TRUE
- return
- //-----------------------------------
- reset_sprites:
- sprite lemlfs bitmap lemlf at 640,yy
- sprite lemfs bitmap lemf at 640,yy
- sprite lemrfs bitmap lemrf at 640,yy
- sprite lemls bitmap leml at 640,yy
- sprite lems bitmap lem at 640,yy
- sprite lemrs bitmap lemr at 640,yy
- return
- //------------------------------------
- landing_test:
- pr = moon[xx+4][yy+27][0]
- pg = moon[xx+4][yy+27][1]
- pb = moon[xx+4][yy+27][2]
- pr1 = moon[xx+34][yy+27][0]
- pg1 = moon[xx+34][yy+27][1]
- pb1 = moon[xx+34][yy+27][2]
- if pr == 0
- if pg == 248
- if pb == 0
- if pr1 == 0
- if pg1 == 248
- if pb1 == 0
- if fps_ <= 1.5
- landing_site = 1
- site1 = TRUE
- call landing_
- return
- if pr == 248
- if pg == 0
- if pb == 0
- if pr1 == 248
- if pg1 == 0
- if pb1 == 0
- if fps_ <= 1.5
- landing_site = 2
- site2 = TRUE
- call landing_
- return
- if pr == 248
- if pg == 248
- if pb == 0
- if pr1 == 248
- if pg1 == 248
- if pb1 == 0
- if fps_ <= 1.5
- landing_site = 3
- site3 = TRUE
- call landing_
- return
- if pr == 0
- if pg == 0
- if pb == 248
- if pr1 == 0
- if pg1 == 0
- if pb1 == 248
- if fps_ <= 1.5
- landing_site = 4
- site4 = TRUE
- call landing_
- return
- if pr == 0
- if pg == 248
- if pb == 248
- if pr1 == 0
- if pg1 == 248
- if pb1 == 248
- if fps_ <= 1.5
- landing_site = 5
- site5 = TRUE
- call landing_
- return
- return
- //------------------------------------
- landing_:
- if visible "status" == TRUE
- textbox "status" = " "
- undisplay element "status"
- if fps_ < 0
- fps_ = 0
- editbox "fps"= fps_
- call reset_sprites
- sprite lems bitmap lem at xx,yy
- update sprites
- stop sound
- delay_sound = TIMER
- while delay_sound > TIMER-100
- play sound neil
- wait sound
- delay_sound = TIMER
- while delay_sound > TIMER-50
- play sound thatis
- wait sound
- call reset_sprites
- update sprites
- display bitmap flag at xx,yy-24 mode DISPLAY_DIRECT
- play sound drums
- wait sound
- landing = TRUE
- call compute_score
- return
- //------------------------------------
- crash_test:
- if yaw == 0
- pr1 = moon[xx+7][yy+10][0]
- pr2 = moon[xx+14][yy+33][0]
- pr3 = moon[xx+36][yy+15][0]
- if pr1 > 0
- if pr1 < 248
- crash_ = TRUE
- call explode
- return
- if pr2 > 0
- if pr2 < 248
- crash_ = TRUE
- call explode
- return
- if pr3 > 0
- if pr3 < 248
- crash_ = TRUE
- call explode
- return
- if yaw == 1
- pr1 = moon[xx+4][yy+27][0]
- pr2 = moon[xx+34][yy+27][0]
- if pr1 > 0
- if pr1 < 248
- crash_ = TRUE
- call explode
- return
- if pr2 > 0
- if pr2 < 248
- crash_ = TRUE
- call explode
- return
- if yaw == 2
- pr1 = moon[xx+2][yy+12][0]
- pr2 = moon[xx+31][yy+9][0]
- pr3 = moon[xx+21][yy+34][0]
- if pr1 > 0
- if pr1 < 248
- crash_ = TRUE
- call explode
- return
- if pr2 > 0
- if pr2 < 248
- crash_ = TRUE
- call explode
- return
- if pr3 > 0
- if pr3 < 248
- crash_ = TRUE
- call explode
- return
- pr = moon[xx+19][yy+50][0]
- pg = moon[xx+19][yy+50][1]
- pb = moon[xx+19][yy+50][2]
- if site1 == TRUE
- if pr == 0
- if pg == 248
- if pb == 0
- crash_ = TRUE
- call explode
- return
- if site2 == TRUE
- if pr == 248
- if pg == 0
- if pb == 0
- crash_ = TRUE
- call explode
- return
- if site3 == TRUE
- if pr == 248
- if pg == 248
- if pb == 0
- crash_ = TRUE
- call explode
- return
- if site4 == TRUE
- if pr == 0
- if pg == 0
- if pb == 248
- crash_ = TRUE
- call explode
- return
- if site5 == TRUE
- if pr == 0
- if pg == 248
- if pb == 248
- crash_ = TRUE
- call explode
- return
- return
- //------------------------------------
- new_game:
- ships_ = 6
- score_ = 0
- site1 = FALSE
- site2 = FALSE
- site3 = FALSE
- site4 = FALSE
- site5 = FALSE
- return
- //------------------------------------
- compute_score:
- if fuel_percent >= 20
- fuel_bonus = 7.5 * fuel_percent
- fuel_bonus = floor fuel_bonus
- contact_ = 1000 - fps_ * 500
- if contact_ == 1000
- if visible "status" == FALSE
- display element "status"
- textbox "status" = "A PERFECT LANDING!"
- play sound fanfare
- wait sound
- contact_ = floor contact_
- last_score = score_
- score_ = score_ + (fuel_bonus + contact_) * landing_site
- score_ = floor score_
- total_score = (fuel_bonus + contact_) * landing_site
- display element "scoreback"
- display element "scorebox"
- display element "rating"
- if contact_ < 600
- textbox "rating" = "*"
- if contact_ >= 600
- if contact_ < 700
- textbox "rating" = "**"
- if contact_ >= 700
- if contact_ < 800
- textbox "rating" = "***"
- if contact_ >= 800
- if contact_ < 900
- textbox "rating" = "****"
- if contact_ >= 900
- textbox "rating" = "*****"
- display element "landing"
- textbox "landing" = contact_
- display element "fuelbonus"
- textbox "fuelbonus" = fuel_bonus
- display element "subtotal"
- textbox "subtotal" = fuel_bonus + contact_
- display element "landingsite"
- if landing_site == 1
- textbox "landingsite" = "X1"
- if landing_site == 2
- textbox "landingsite" = "X2"
- if landing_site == 3
- textbox "landingsite" = "X3"
- if landing_site == 4
- textbox "landingsite" = "X4"
- if landing_site == 5
- textbox "landingsite" = "X5"
- display element "totalscore"
- textbox "totalscore" = total_score
- score_delay = TIMER
- while score_delay > TIMER - 100
- while last_score < score_
- if playing "click.wav" == FALSE
- display element "click.wav"
- last_score = last_score + 3
- editbox "score" = last_score
- last_score = score_
- editbox "score" = score_
- if playing "click.wav" == TRUE
- stop element "click.wav"
- if site1 == TRUE
- if site2 == TRUE
- if site3 == TRUE
- if site4 == TRUE
- if site5 == TRUE
- if ships_ == 1
- ships_ = 0
- score_delay = TIMER
- while score_delay > TIMER - 100
- if visible "status" == FALSE
- display element "status"
- textbox "status" = "EXTRA BONUS 1000 POINTS!"
- play sound fanfare
- wait sound
- score_delay = TIMER
- while score_delay > TIMER - 100
- score_ = score_ + 1000
- while last_score < score_
- if playing "click.wav" == FALSE
- display element "click.wav"
- last_score = last_score + 3
- editbox "score" = last_score
- editbox "score" = score_
- if playing "click.wav" == TRUE
- stop element "click.wav"
- return
- //-----------------------------------
- high_score:
- if score_ > high.score
- high.score = score_
- save "hiscore.dat" object high
- if visible "status" == FALSE
- display element "status"
- textbox "status" = "NEW HIGH SCORE!"
- play sound fanfare
- wait sound
- delay_ = TIMER
- while delay_ > TIMER - 100
- display element "whiteout"
- play sound photon
- undisplay element "whiteout"
- textbox "highscore" = score_
- wait sound
- play sound cool
- wait sound
- return
- //------------------------------------
- reset_highscore:
- textbox "highscore" = "0"
- return
- //------------------------------------
- display_high_score:
- if visible "highscore" == FALSE
- display element "highscore"
- textbox "highscore" = highscore_
- //------------------------------------
- quit_:
- display element "shot.wav"
- wait sound
- free all
- exit
-
-